package com.iadmin.web.demo.dao;

import com.iadmin.web.demo.entity.Tuser;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TuserDao extends JpaRepository<Tuser, Long> {

    Tuser findByUserName(String userName);

    @Query("from Tuser t where id = :id")
    List<Tuser> queryFamilyList(@Param("id") Long id, Pageable pageable);

}